﻿using System;
using Eneta.Portal.Forum.Core.Data;
using Eneta.Portal.Forum.Core.Domain.Collections;
using Eneta.Portal.Forum.Core.Domain.Entities;

namespace Eneta.Portal.Forum.Core.Domain.Repositories
{
    public class MessageRepository
    {
        // Fields
        private readonly MessageDao _dao = new MessageDao();

        // Methods
        public MessageCollection FindByDate(DateTime dateCriteria)
        {
            return _dao.FindByDate(dateCriteria);
        }

        public MessageCollection FindByKeywords(string keywords)
        {
            return _dao.FindByKeywords(keywords);
        }

        public MessageCollection GetAll()
        {
            return _dao.GetAll();
        }

        public Message GetById(int id)
        {
            return _dao.GetById(id);
        }

        public MessageCollection GetByTopicId(int id)
        {
            return _dao.GetByTopicId(id);
        }

        public void Save(Message message)
        {
            _dao.Save(message);
        }
    }
}
